package net.spring.controller;

import com.itheima.po.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.itheima.po.Orders;

@Controller
public class OrdersController {
      
	
	@RequestMapping("/tofindOrdersWithUser")
	public String tofindOrderWithUser() {
		return "orders";
	}	
	 @RequestMapping("/findOrderWithUser")
	 public String findOrderWithUser(Orders orders) {
		
		 User user=orders.getUser();
		 String username=user.getUsername();
		 System.out.println("orderId="+orders.getId());
		 System.out.println("username="+username);
		 return "success";
	 }
	}

